Skip to content

Add support for attributes on constants#1082

Merged
nikic merged 1 commit intonikic:masterfrom
DanielEScherzer:attributes-on-constants
Apr 29, 2025
Merged

Add support for attributes on constants#1082
nikic merged 1 commit intonikic:masterfrom
DanielEScherzer:attributes-on-constants

Conversation

@DanielEScherzer
Copy link
Copy Markdown
Contributor

Just merged in php/php-src@3f03f7e, updating this parser is needed to be able to use attributes on constants in the stub files.

Copy link
Copy Markdown
Owner

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add pretty printer support and a pretty printer test.

This will also need an extra resolveAttrGroups call in NameResolver.

(See https://github.com/nikic/PHP-Parser/blob/master/CONTRIBUTING.md#adding-support-for-new-php-syntax for the full checklist.)

@DanielEScherzer DanielEScherzer force-pushed the attributes-on-constants branch from 75d5451 to 3f6f8a4 Compare April 29, 2025 20:37
@DanielEScherzer
Copy link
Copy Markdown
Contributor Author

Please also add pretty printer support and a pretty printer test.

This will also need an extra resolveAttrGroups call in NameResolver.

(See https://github.com/nikic/PHP-Parser/blob/master/CONTRIBUTING.md#adding-support-for-new-php-syntax for the full checklist.)

Done, thanks for the pointer

Copy link
Copy Markdown
Owner

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix the phpstan errors I believe.

@nikic
Copy link
Copy Markdown
Owner

nikic commented Apr 29, 2025

Also need to regenerate the parsers.

Just merged in php/php-src@3f03f7e, updating
this parser is needed to be able to use attributes on constants in the stub
files.
@DanielEScherzer DanielEScherzer force-pushed the attributes-on-constants branch from 270df0f to b3fd332 Compare April 29, 2025 20:57
@nikic nikic merged commit 4964f8d into nikic:master Apr 29, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants